package com.learn.account.web;

import com.learn.account.service.IAccountTblService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * <p>
 *   前端控制器
 * </p>
 *
 * @author zhaofa
 * @since 2019-11-12
 */
@RestController
public class AccountTblController {
    @Autowired
    private IAccountTblService accountService;
    @RequestMapping("/reduce")
    public Boolean debit(String userId, BigDecimal money) {
        accountService.reduce(userId, money);
        return true;
    }
}
